Skip to content

Add tests of HTTP normalization on app level - #3527

Merged
bajtos merged 1 commit into
strongloop:masterfrom
lehni:feature/test-http-normalization
Aug 3, 2017
Merged

bajtos merged 1 commit into
strongloop:masterfrom
lehni:feature/test-http-normalization

Conversation

@lehni

@lehni lehni commented Jul 29, 2017 •

Copy link
Copy Markdown
Contributor

Description

As discussed in #608 (comment), this PR adds and improves tests for HTTP normalization both on application and model level, including tests for nested routes. Please note that these tests require the changes in strongloop/strong-remoting#410 to not fail.

Related issues

#608, strongloop/strong-remoting#410

Checklist

  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style
    guide

@slnode

slnode commented Jul 29, 2017

Copy link
Copy Markdown

Can one of the admins verify this patch? To accept patch and trigger a build add comment ".ok\W+to\W+test."

@slnode

slnode commented Jul 29, 2017

Copy link
Copy Markdown

Can one of the admins verify this patch?

3 similar comments
@slnode

slnode commented Jul 29, 2017

Copy link
Copy Markdown

Can one of the admins verify this patch?

@slnode

slnode commented Jul 29, 2017

Copy link
Copy Markdown

Can one of the admins verify this patch?

@slnode

slnode commented Jul 29, 2017

Copy link
Copy Markdown

Can one of the admins verify this patch?

@bajtos

bajtos commented Aug 2, 2017

Copy link
Copy Markdown
Member

@slnode ok to test

@bajtos bajtos self-assigned this Aug 2, 2017

@bajtos bajtos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks mostly good, could you please improve the coding style little bit per my comments below?

Let's wait with landing this patch until strongloop/strong-remoting#410 is landed and released.

Comment thread test/app.test.js Outdated
});

describe(
'`Model.remoting.normalizeHttpPath` and `app.remoting.rest.normalizeHttpPath` options',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's shorten this title to something like Model-level and app-level normalizeHttpPath option

Comment thread test/app.test.js Outdated
});

it.onServer(
'should give `Model.remoting.normalizeHttpPath` precedence over ' +

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are trying to avoid should prefix in new test names, see http://loopback.io/doc/en/contrib/style-guide.html. This applies to other test names added by this pull request too.

I am proposing to shorten the test name too, e.g. prioritizes model-level setting over the app-level one.

The full test name will include the title from describe, which already contains normalizeHttpPath. No need to repeat it here again...

...Model-level and app-level normalizeHttpPath option prioritizes model-level setting over the app-level one

@lehni

lehni commented Aug 2, 2017

Copy link
Copy Markdown
Contributor Author

@bajtos thanks! I've made the adjustments: 2c257ff

@bajtos bajtos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the update, the changes LGTM now 👍

Let's wait until strongloop/strong-remoting#410 is landed to verify the new tests are passing on all our CI platforms.

@bajtos bajtos added the blocked label Aug 3, 2017
@bajtos

bajtos commented Aug 3, 2017

Copy link
Copy Markdown
Member

@slnode test please

Also improve tests on model level to include nested routes

Add a test for HTTP normalization precedence too.
@bajtos
bajtos merged commit d3d0ef4 into strongloop:master Aug 3, 2017
@bajtos bajtos removed the blocked label Aug 3, 2017
@bajtos

bajtos commented Aug 3, 2017

Copy link
Copy Markdown
Member

Landed, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants